package com.campus.common.config;

/**
 * @Author: AlaskaBoo
 * @Date: 2022-10-04 21:07
 **/
public enum CodeConfig {
    /**
     * 错误
     */
    ERROR(100, "失败"),
    ERROR_REGISTER(500, "注册失败"),
    PARAM_ERROR(101, "参数错误"),

    /**
     * 图片上传返回值
     */
    PIC_UPLOAD_FAIL(6000, "图片上传失败"),
    PIC_HAVE_QUEUE(200, "图片审核成功"),
    PIC_HAVE_QUEUE_FAIL(500, "图片审核失败"),
    PIC_UPLOAD_SUCCESS(6001, "图片上传成功"),
    PIC_DELETE_SUCCESS(6002, "图片删除成功"),
    PIC_DELETE_FAIL(6003, "图片删除成功"),
    ERROR_MAX_FileUpload(50000, "图片过大大小超过1M"),
    ERROR_REFUSE_FileUpload(50001, "文件类型不符合"),
    ERROR_IMG_ERRO(10015, "该图片违规"),

    /**
     * 权限不足
     */
    PERMISSION_DENIED(105, "权限不足"),

    /**
     * 成功
     */
    SUCCESS(200, "操作成功"),
    QUERY_SUCCESS(200, "查询成功"),
    QUERY_FAIL(500, "未查询到该信息"),
    UPDATE_SUCCESS(200, "更新成功"),
    UPDATE_FAIL(500, "更新失败"),
    SAVE_SUCCESS(200, "添加成功"),
    SAVE_FAIL(500, "添加失败"),
    DELETE_SUCCESS(200, "删除成功"),
    DELETE_FAIL(500, "删除失败"),
    /**
     * 请求
     */
    FUNCTION_NOT_OPEN(400, "功能未开放"),
    ACCESS_LIMIT(401, "请求次数频繁"),
    ERROR_REQUEST_TYPE(405, "请求方法出错，请重试"),
    SERVER_BUSY(500, "服务器繁忙,请重试"),

    /**
     * 账号
     */
    ERROR_PASSWORD(10010, "用户名或密码错误"),
    DELETE_USER(200, "删除用户成功"),
    NOT_LOGIN(500, "用户未登录"),
    ERROR_Information(10011, "未查询到该信息"),
    JOIN_FAIL(500, "你已经加入班级，无需重复添加"),
    Clazz_NOTFOUND(500, "该班级不存在"),

    /**
     * 序列化
     */
    ERROR_SERIALIZE(10012, "序列化失败"),
    ERROR_DESERIALIZE(10013, "反序列化失败"),
    ERROR_USER_EXISTS(10014, "已存在账号信息"),
    ERROR_REPORT(10016, "你已经举报过了"),

    /**
     * 缓存服务器异常
     */
    REDIS_MISS(20000, "缓存服务器异常"),
    ERROR_LOST_DELETE(30006, "删除信息不存在");


    public final Integer code;
    public final String message;

    CodeConfig(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
